package com.ruoyi.web.controller.controllers;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.provider.domain.AhctImage;
import com.ruoyi.provider.service.AhctImageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
 * 图片素材管理表
 */

@RestController
@RequestMapping("/img")
public class AhctImageController extends BaseController {

    @Resource
    private AhctImageService ahctImageService;


    //删除图片
    @PostMapping("/deleteImg")
    public AjaxResult deleteImg(@RequestBody AhctImage ahctImage){
        ahctImageService.deleteImgOne(ahctImage);
        return success(0);
    }

    //查看图片
    @PostMapping("/selectImg")
    public AjaxResult getImg(@RequestBody AhctImage ahctImage){
        List<AhctImage> img = ahctImageService.getSurveyImage(ahctImage.getCase_number());
        return success(img);
    }

}
